//
import Taro , { Component } from '@tarojs/taro';
import { View , Image } from '@tarojs/components';
import { baseImgSrc } from '../../util/base_url'; 
import './nodata.scss';
export default class NoData extends Component {
    constructor(props){
        super(props)
    }
    render(){
        let { noDataTxt = '' , needShow , pic = '/no-data.png' , size = 'max'} = this.props;
        let classType = 'no-data-pic'
        switch(size){
            case 'max':
                classType = 'no-data-pic'
                break;
            case 'small':
                classType = 'no-data-pic-small'
                break;
        }
        return(
            <View class={'no-data ' + (needShow ? 'disblock' : 'disnone')}>
                <Image className={classType} src={`${baseImgSrc}${pic}`} />
                <View className='txt'>{noDataTxt}</View>
            </View>
        )
    }
}